package report;

import java.io.File;
import java.io.FileInputStream;

import jxl.Sheet;
import jxl.Workbook;
import jxl.WorkbookSettings;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;

public class JxlTest {

	public static void main(String[]args){
		
		try{
			File file1=new File("d:/file1.xls");
			File file2=new File("d:/file2.xls");
			
			 WorkbookSettings workbookSettings = new WorkbookSettings();
	     workbookSettings.setEncoding("UTF-8");
	     WritableWorkbook rwb1 = Workbook.createWorkbook(file1);
	     Workbook rwb2 = Workbook.getWorkbook( new FileInputStream(file2), workbookSettings);
	     
	     Sheet st1 = rwb1.getSheet(0);
	     
	     Sheet st2 = rwb2.getSheet(0);
	     st2=st1;
	     WritableWorkbook wwb = Workbook.createWorkbook(new File("d:file3.xls"));
	     WritableSheet ws0 = wwb.createSheet("ceshi", 0);
	     WritableSheet ws1 = wwb.createSheet("ceshi11", 1);
//	     ws0=(WritableSheet)st1.se;
	     ws1=(WritableSheet) st2;
	     wwb.write();
			System.out.println("::::::");
		}catch(Exception e){
			e.printStackTrace();
		}
		
	}
}
